package ru.ifmo.kis.domaingen;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

// Nov 24, 2010 4:09:34 PM
@javax.persistence.Table(name = "orderedmaterials", catalog = "ItmoKis")
@Entity
public class OrderedMaterialsEntity {
	private int delivery;

	@javax.persistence.Column(name = "delivery", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Basic
	public int getDelivery() {
		return delivery;
	}

	public void setDelivery(int delivery) {
		this.delivery = delivery;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		OrderedMaterialsEntity that = (OrderedMaterialsEntity) o;

		if (delivery != that.delivery) return false;

		return true;
	}

	@Override
	public int hashCode() {
		return delivery;
	}

	private MaterialsEntity material;

	@Id
	@OneToOne
	public
	@javax.persistence.JoinColumn(name = "material", referencedColumnName = "id", nullable = true)
	MaterialsEntity getMaterial() {
		return material;
	}

	public void setMaterial(MaterialsEntity material) {
		this.material = material;
	}
}
